#include <cstdio>

using namespace std;

typedef long long ll;
const int maxn=300, maxm=maxn*(maxn-1)/2, mods=998244353;

ll solve1(int n) {
	static ll f[2*maxn+1][maxn+1];
	f[0][0] = 1;
	for (int i=1; i<=2*n; i++) {
		f[i][0] = f[i-1][1];
		for (int j=1; j<n; j++) {
			f[i][j] = (f[i-1][j-1]+f[i-1][j+1])%mods;
		}
		f[i][n] = f[i-1][n-1];
	}
	return f[2*n][0];
}

ll dfs(int o, int v, int n, int m, int f[], int g[]) {
	static int s[2*maxn+1];
	static bool out[maxn+1];
	if (o<=2*n) {
		ll ret=0;
		if (v<=n) {
			s[++s[0]] = v;
			ret = (ret+dfs(o+1, v+1, n, m, f, g))%mods;
			s[0]--;
		}
		if (s[0]) {
			int t=s[s[0]];
			bool flag=true;
			for (int i=1; i<=m && flag; i++) {
				if ((f[i]==t && out[g[i]]) || (g[i]==t && !out[f[i]])) {
					flag = false;
				}
			}
			if (flag) {
				s[0]--;
				out[t] = true;
				ret = (ret+dfs(o+1, v, n, m, f, g))%mods;
				out[t] = false;
				s[++s[0]] = t;
			}
		}
		return ret;
	} else return 1;
}

ll solve2(int n, int m) {
	static int f[maxm+1], g[maxm+1];
	for (int i=1; i<=m; i++) {
		scanf("%d %d", f+i, g+i);
	}
	return dfs(1, 1, n, m, f, g);
}

int main() {
	freopen("catalan.in", "r", stdin);
	freopen("check.out", "w", stdout);

	int n, m;
	scanf("%d %d", &n, &m);
	printf("%lld\n", m==0 ? solve1(n) : solve2(n, m));

	fclose(stdin);
	fclose(stdout);
	return 0;
}
